package localhost.axis.services.Admin_Users;

public class AdminProxy implements localhost.axis.services.Admin_Users.Admin {
  private String _endpoint = null;
  private localhost.axis.services.Admin_Users.Admin admin = null;
  
  public AdminProxy() {
    _initAdminProxy();
  }
  
  public AdminProxy(String endpoint) {
    _endpoint = endpoint;
    _initAdminProxy();
  }
  
  private void _initAdminProxy() {
    try {
      admin = (new localhost.axis.services.Admin_Users.AdminServiceLocator()).getAdmin_Users();
      if (admin != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)admin)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)admin)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (admin != null)
      ((javax.xml.rpc.Stub)admin)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public localhost.axis.services.Admin_Users.Admin getAdmin() {
    if (admin == null)
      _initAdminProxy();
    return admin;
  }
  
  public boolean is_session_still_valid(java.lang.String login) throws java.rmi.RemoteException{
    if (admin == null)
      _initAdminProxy();
    return admin.is_session_still_valid(login);
  }
  
  public boolean connect(java.lang.String login, java.lang.String password) throws java.rmi.RemoteException{
    if (admin == null)
      _initAdminProxy();
    return admin.connect(login, password);
  }
  
  public void disconnect(java.lang.String login) throws java.rmi.RemoteException{
    if (admin == null)
      _initAdminProxy();
    admin.disconnect(login);
  }
  
  public void create_User(java.lang.String login_user, java.lang.String login_to_create) throws java.rmi.RemoteException{
    if (admin == null)
      _initAdminProxy();
    admin.create_User(login_user, login_to_create);
  }
  
  public boolean delete_user(java.lang.String login_user, java.lang.String login_a_supprimmer) throws java.rmi.RemoteException{
    if (admin == null)
      _initAdminProxy();
    return admin.delete_user(login_user, login_a_supprimmer);
  }
  
  public boolean change_user_password(java.lang.String login, java.lang.String password, java.lang.String new_password) throws java.rmi.RemoteException{
    if (admin == null)
      _initAdminProxy();
    return admin.change_user_password(login, password, new_password);
  }
  
  public void change_user_priviledge(java.lang.String login, java.lang.String login_to_modify, int priviledge) throws java.rmi.RemoteException{
    if (admin == null)
      _initAdminProxy();
    admin.change_user_priviledge(login, login_to_modify, priviledge);
  }
  
  public boolean clear_logs(java.lang.String login) throws java.rmi.RemoteException{
    if (admin == null)
      _initAdminProxy();
    return admin.clear_logs(login);
  }
  
  
}